package restaurant.gui.simulation;

import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

/**
 * This JPanel contains the variables affected when running the simulation.
 * 
 * @author Odessa
 */
@SuppressWarnings("serial")
public class VariablesPanel extends JPanel
{

	/** The customer flow text field. */
	private JTextField customerFlowField;

	/** The time at table text field. */
	private JTextField timeAtTableField;

	/** The number of tables text field. */
	private JTextField numTablesField;

	/** The time to prepare text field. */
	private JTextField timeToPrepareField;



	/**
	 * Creates the panel and the text fields.
	 */
	public VariablesPanel() {
		setBorder(new EmptyBorder(0, 5, 0, 5));
		setLayout(new GridLayout(2, 2, 10, 10));

		numTablesField = new JTextField();
		timeAtTableField = new JTextField();
		customerFlowField = new JTextField();
		timeToPrepareField = new JTextField();

		setFields();
	}



	/**
	 * Adds the text fields to the panel.
	 */
	private void setFields()
	{
		// Set the numTablesField
		numTablesField.setHorizontalAlignment(SwingConstants.CENTER);
		numTablesField.setText("Num Tables");
		add(numTablesField);
		numTablesField.setColumns(10);

		// Set the timeAtTableField
		timeAtTableField.setText("Time at Table");
		timeAtTableField.setHorizontalAlignment(SwingConstants.CENTER);
		add(timeAtTableField);
		timeAtTableField.setColumns(10);

		// Set the customerFlowField
		customerFlowField.setText("CustomerFlow");
		customerFlowField.setHorizontalAlignment(SwingConstants.CENTER);
		add(customerFlowField);
		customerFlowField.setColumns(10);

		// Set the timeToPrepare
		timeToPrepareField.setText("TimeToPrepare");
		timeToPrepareField.setHorizontalAlignment(SwingConstants.CENTER);
		add(timeToPrepareField);
		timeToPrepareField.setColumns(10);
	}

}
